<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>冒泡事件</title>
<style>
    .outside{
        width: 200px;
        height: 100px;
        border: 1px solid red;
        text-align: center;
    }
    .inside{
        width: 100px;
        height: 50px;
        border:1px solid black;
        margin:15% 25%;
    }
</style>
</head>
<body>
<div id="app">
    <div class="outside" @click="outside">
        <div class="inside" @click.stop="inside">阻止事件冒泡</div>
    </div>
</div>

<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    //创建一个应用程序实例
    const vm= Vue.createApp({
        methods: {
            outside: function () {
                alert("外面div的单击事件")
            },
            inside: function () {
                alert("内部div的单击事件")
            }
        }
    //在指定的DOM元素上装载应用程序实例的根组件
    }).mount('#app');
</script>

</body>
</html>
